# -*- coding:utf-8 -*-

from flask_wtf import FlaskForm
from wtforms import StringField, PasswordField, BooleanField, SubmitField
from wtforms.validators import Required, Length, Email, Regexp, EqualTo, DataRequired

# 用户登录表单
class LoginForm(FlaskForm):
    uname = StringField(u'用户名：', validators=[
        DataRequired(), Length(1,64), '^[A-Za-z][A-Za-z0-9_.]*$', 0, u'用户名必须由字母、数字、下划线或 . 组成'])
    pwd = PasswordField(u'密码：', validators=[DataRequired()])
    remember_me = BooleanField(u'记住我？')
    submit = SubmitField(u'登录')